﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using NUnit.Framework;
using Moq;
using SportsStore.Repository.Interfaces;
using SportsStore.ServicesInterfaces;

namespace SportsStore.UnitTests.Services
{
  public class CategoryServiceTest
  {
    [SetUp]
    public void Setup()
    {
      _categoryRepository = new Mock<ICategoryRepository>();
      _categoryService = new SportsStore.Services.CategoryService(_categoryRepository.Object);
    }

    private ICategoryService _categoryService;
    private Mock<ICategoryRepository> _categoryRepository;

    [Test]
    public void GivenValidData_WhenIAskForDistinctCategories_TheTheCategoriesAreReturned()
    {
      _categoryRepository.Setup(p => p.GetCategories()).Returns(new List<string>() { string.Empty });
      var categories = _categoryService.GetCategories();
      Assert.That(categories.Count(), Is.EqualTo(1));
    }
  }
}
